package Model;

import java.awt.Dimension;
import java.awt.Paint;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PiePlot3D;
import org.jfree.data.general.PieDataset;
import org.jfree.util.Rotation;

import DataLayer.DaoAccountPieChart;

@SuppressWarnings("serial")
public class PieChart extends ChartPanel {

	
	 public PieChart(JFreeChart s) {
		super(s);
		PieDataset dataset = DaoAccountPieChart.getInstance().getPieSet();
		
			setPreferredSize(new Dimension(500, 270));  
	        JFreeChart chart = ChartFactory.createPieChart3D("rekeningOverzicht", dataset);
	        chart.setBackgroundPaint(Color(239, 238, 237));
	        PiePlot3D pieplot = (PiePlot3D)chart.getPlot();   
	        pieplot.setNoDataMessage("No data available");
	        pieplot.setStartAngle(290);
	        pieplot.setForegroundAlpha(0.5f);
	        pieplot.setDirection(Rotation.CLOCKWISE);
	        setChart(chart);

	}

	private Paint Color(int i, int j, int k) {
		// TODO Auto-generated method stub
		return null;
	}
}
